(function(){
    var name;
    if(typeof name==="undefined"){
        name="Jack";
        console.log("goofbye "+name);
    }else{
        console.log("hello "+name);
    }
})()